import java.sql.SQLOutput;

public class Student {
    public String name;
    public int age;
    public static String classroom ;//
    // 三个同学都在这一个教室上课，就可以把它设为静态的
    //静态的成员变量，不属于对象
    public Student (){
        this("鼠标",9);
        System.out.println("Student().....");
    }
    public Student(String name,int age){
        this.name = name;
        this.age = age;
        System.out.println("Student(String,int)...");

    }
    //静态代码块
    static {
        classroom = "bjisbc";
        System.out.println("这是一个静态代码块");
    }
    //构造块
    {
        System.out.println("构造代码块/实例代码块");
    }
    public void eat(){
        System.out.println(this.name+"吃饭");
    }
    public void show(){
        System.out.println("姓名："+this.name+"年龄："+this.age);
    }

    @Override
    public String toString() {
        return "Student{" +
                "姓名='" + name + '\'' +
                ", 年龄=" + age +
                '}';
    }
}
